<?php

session_start();


include_once('connection.php');

$productID = $_POST['productID'];
$arrlength=count($_SESSION['cart']);

for($x=0;$x<$arrlength;$x++)
  {
     $arr = explode("," ,$_SESSION['cart'][$x]);
	 if($arr[0] == $productID){
		unset($_SESSION['cart'][$x]);
		$_SESSION['cart'] = array_values($_SESSION['cart']);

	 }
  }
  
  ?> 
           <script>
				window.location.href = 'cart.php';
			</script>
        <?php
		

?>
